package com.czkj.hwz.decorate.Activity;

import android.os.Build;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.ListView;

import com.czkj.hwz.decorate.R;
import com.czkj.hwz.decorate.adapter.HomeDecorationAdapter;
import com.king.base.BaseActivity;

import java.util.ArrayList;
import java.util.List;

public class HomeDecorationActivity extends BaseActivity {
    private ListView lv;
    private HomeDecorationAdapter homeDecorationAdapter;
    private List<String> stringList;
    private EditText search_text;
    @Override
    public void initUI() {
        if (Build.VERSION.SDK_INT >= 21){
            Window window = getWindow();
            //取消设置透明状态栏,使 ContentView 内容不再覆盖状态栏
            window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            //需要设置这个 flag 才能调用 setStatusBarColor 来设置状态栏颜色
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            //设置状态栏颜色
            window.setStatusBarColor(getResources().getColor(R.color.yellow));
        }
        setContentView(R.layout.activity_home_decoration);
        getSupportActionBar().hide();
        lv=findView(R.id.lv);
        search_text = findView(R.id.search_text);
        String keyword=getIntent().getStringExtra("keyword");
        search_text.setText(keyword);
        stringList=new ArrayList<>();

    }

    @Override
    public void initData() {
        for (int i=0;i<5;i++) {
            stringList.add(new String("淮安筑梦天下装饰公司"));
        }
        homeDecorationAdapter=new HomeDecorationAdapter(context,stringList);
        lv.setAdapter(homeDecorationAdapter);
    }

    @Override
    public void addListeners() {

    }
    public void OnClick(View v) {
        switch (v.getId()) {
            case R.id.iv_back:
                finish();
                break;
        }
    }
}
